#pragma once

#include "../Headers/types.h"
#include "../Headers/authr.h"
#include "../NS/nameserver.h"

#include "um.rpc.h"

#include <string>

namespace TOB {
  namespace UM {
  
    class Client : AuthRequired {
    private:
      CLIENT* clnt;
      bool nsconnected;
      bool usconnected;
      bool connected;
      Nameserver::IP UMIP;
      std::string UMHost;
    public:
      Client(Nameserver::IP nsip, std::string username, std::string password);
      ~Client();
      
      Code::Type changeFieldByLogin(std::string login, std::string field, std::string value);
      Code::Type createUser(std::string login, std::string pass, std::string role, std::string policy, std::string name="");
      Code::Type deleteUser(std::string login);
    };
  }
}
